Include support for banner/ajax/load controller (enterprise specific)#13
Include support for banner/ajax/load controller (enterprise specific)#13davidalger wants to merge 1 commit into
Conversation
|
Thank you very much for your contribution! This brings up an interesting topic, I'd definitely like to support improvements for Magento Commerce, while staying compatible with the open source version.
I don't see this as a downside at all. In fact I prefer having a single extension, consisting of multiple modules with different dependencies, where you can choose which modules to install. How would this work?
|
|
@schmengler another approach could be about moving it to separate composer module which depends on this one and then there would be two different ways to install it for Open Source and Commerce eg.: Open Source: Commerce: |
Have a Magento Commerce 2.2 site which I just rolled out a modified version of this extension on a short while ago. Enterprise has a
banner/ajax/loadcall which similarly reads from session, but never writes, so the changes here are adding support for that.On my local test site with a
sleep(5)added to exaggerate requests to bothbanner/ajax/loadandcustomer/section/loadfor easily testing the lock release I get the following results:Before installation (click to expand image):

After modified module is installed (click to expand image):

For now, I have this installed on the site by adding the following into the
composer.jsonfile to pull the modified module:Given these changes introduce a hard dependency on the Commerce/Enterprise only
Magento\Banner\Controller\Ajax\Loadclass intests/Integration/AbstractSessionTest.php, the integration tests will fail if they are run from an open-source code base. DI rules targeting non-existent classes are merely ignored, so the module will install and run no problem on open-source however (verified this on a vanilla 2.3.3 OS with sample data).I'm opening this PR both to share the work that I've done, but also ask for ideas on path forward to supporting controllers that do not exist in open-source. Have you guys thought about this yet and what might you suggest to support both open-source and enterprise?
One thought I had is perhaps splitting it to a separate module dependent on this one, keeping them nice and clean but that has the downside of multiple modules to maintain. Alternatively, the tests could be setup so only the open-source tests are run perhaps by using a different phpunit.xml file for enterprise and opensource integration testing where the enterprise one included additional tests, and then splitting
AbstractSessionTest::setUpSpiesout of the abstract to avoid hard dependencies on irrelevant controller classes.Thoughts?